package com.atguigu.chapter05

object TestFunction5 {

  def main(args: Array[String]): Unit = {
    def calculator(a: Int,b: Int,op: (Int,Int)=>Int):Int = {
      op(a, b)
    }

    println(calculator(2, 3, (x: Int, y: Int) => {
      {
        x + y
      }
    }))

    println(calculator(2, 3, (x, y) => x + y))

    println(calculator(2, 3,  _ + _))
  }
}
